
#include "UtilityProps.h"
#include "Common/Extras.h"

using namespace ttg;
using namespace ttg::utils;
using namespace ttg::extras::serialization;

//--------------------
//--- UtilityProps ---
//--------------------

void UtilityProps::serialize(extras::serialization::Serializer &serializer)
{
	serializer.serializeString(getName(), "name");
	serializer.serializeInt(position, "position");
	serializer.serializeBool(isHidden, "isHidden");
	serializer.serializeInt(onError, "onError");
}

void UtilityProps::deserialize(extras::serialization::DeSerializer &deserializer)
{
	std::string name;
	int position;
	int onError;
	deserializer.deserializeString(name, "name");
	this->setName(name.c_str());
	deserializer.deserializeInt(position, "position");
	this->position = (Position)position;
	deserializer.deserializeBool(isHidden, "isHidden");
	deserializer.deserializeInt(onError, "onError");
	this->onError = (ErrorHandler)onError;
}
